package com.example.javabasic.thread.classtwo.threadlocal.demo3;

public class ActionContext {
    private static final ThreadLocal<Context> threadLocal  = new ThreadLocal<Context>(){
        @Override
        protected Context initialValue() {
            return new Context();
        }
    };



    public Context getContext(){
        return threadLocal.get();
    }


    private static class Instance{
        private static final ActionContext  actionContext = new ActionContext();

    }

    public static ActionContext getInstance(){
        return Instance.actionContext;
    }
}
